package jme3

import com.jme3.app.SimpleApplication
import com.jme3.material.Material
import com.jme3.math.ColorRGBA
import com.jme3.scene.Geometry
import com.jme3.scene.shape.Box

/** Sample 1 - how to get started with the most simple JME 3 application.
 * Display a blue 3D cube and view from all sides by
 * moving the mouse and pressing the WASD keys.  */
class HelloJME3 : SimpleApplication() {
    override fun simpleInitApp() {
        val b = Box(1f, 1f, 1f) // create cube shape
        val geom = Geometry("Box", b) // create cube geometry from the shape
        val mat = Material(
            assetManager,
            "Common/MatDefs/Misc/Unshaded.j3md"
        ) // create a simple material
        mat.setColor("Color", ColorRGBA.Blue) // set color of material to blue
        geom.material = mat // set the cube's material
        rootNode.attachChild(geom) // make the cube appear in the scene
    }
}

fun main() {
    val app = HelloJME3()
    app.start() // start the game
}